@extends('layout.index')
@section('title', '商品列表')
@section('content')
<div class="mws-panel grid_8">
    <div class="mws-panel-header">
      <span>商品列表页</span>
    </div>
    <form action="/admin/goods/index" method='get'>
    <div class="mws-panel-body no-padding">
      <div role="grid" class="dataTables_wrapper" id="DataTables_Table_0_wrapper">
        <div id="DataTables_Table_0_length" class="dataTables_length">
          <label>显示<select name="num" size="1" aria-controls="DataTables_Table_0">
            <option value="10" @if(!empty($request['num']) && $request['num']==10)
                                    selected
                              @endif
            >
              10
            </option>

            <option value="15" @if(!empty($request['num']) && $request['num']==15)
                                    selected
                              @endif>
              15
            </option>

            <option value="20" @if(!empty($request['num']) && $request['num']==20)
                                    selected
                              @endif>
              20
            </option>

            
          </select>页</label>
        </div>

        <div class="dataTables_filter" id="DataTables_Table_0_filter">
          <label>关键字: <input value="{{$request['keywords'] or ''}}" type="text" name="keywords"  aria-controls="DataTables_Table_0" />
            <button class="btn btn_default">查询</button>
          </label>
        </div>
        </form> 

        <table class="mws-datatable mws-table dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
          <thead>
            <tr role="row">
              <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 156px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">id</th>

              <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 212px;" aria-label="Browser: activate to sort column ascending">商品名</th>

              <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 197px;" aria-label="Platform(s): activate to sort column ascending">商品分类</th>

             
               <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 133px;" aria-label="Engine version: activate to sort column ascending">商品图片</th>
               

                 <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 133px;" aria-label="Engine version: activate to sort column ascending">商品状态</th>

                  <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 133px;" aria-label="Engine version: activate to sort column ascending">商品描述</th>
                   <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 133px;" aria-label="Engine version: activate to sort column ascending">专区</th>

                   <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 133px;" aria-label="Engine version: activate to sort column ascending">商品时间</th>

              <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 97px;" aria-label="CSS grade: activate to sort column ascending">操作</th>
            </tr>
          </thead>

          <tbody role="alert" aria-live="polite" aria-relevant="all">
          @foreach($goods as $k=>$v)
            <tr class="
                @if($k%2 ==0 )
                even
                @else
                odd
                @endif

            ">
              <td class=" sorting_1">{{$v->id}}</td>

              <td class="">{{$v->proname}}</td>

              <td class="">{{$v->catename}}</td>
              
             
              <td class=""><img src="{{$v->image}}" alt="" width='100px'></td>
              
             

              <td class="">{{ str_replace([0,1,2,3,4],['热销','首发','下架','缺货','有货'], $v->state) }}</td>

           

              <td ><a href="/admin/goods/des/{{$v->id}}"><i class="icon-attachment">详情</i></a></td>



               <td class="">{{ str_replace([0,1,2,3,4,5],['小米手机','红米手机','小米平板','小米电视','硬件专区','配件专区'], $v->zome) }}
              <td class="">{{$v->addtime}}</td>

              <td class="">
                    <a href="/admin/goods/edit/{{$v->id}}" id='yanse'><i class="icon-wrench"></i></a>
                    |
                    <a href="/admin/goods/delete/{{$v->id}}" id='yanse'><i class="icon-trash"></i></a>
             </td>
            </tr>
    @endforeach
            

          
          </tbody>
        </table>

        <div class="dataTables_info" id="DataTables_Table_0_info">
         显示的页码数
        </div>

        <div class="dataTables_paginate paging_two_button" id="pages">
             {!! $goods->appends($request)->render() !!}

                 
        </div>
      </div>
    </div>
  </div>

@endsection



